#ifndef CDevOut_h
#define CDevOut_h

#include <Windows.h>
#include <string>

class CDevOut
{
public:
    CDevOut():x(0),y(0){}
    void AcceptData(const char sim)           { std::string data; data = sim;  ViewText(x,y, 11, data);   x += 1;  }
    void AcceptData(const std::string& data)  {  ViewText(x,y, 12, data);   x += data.size(); }

    void ViewText(size_t x, size_t y, size_t c, const std::string& text)   
    {  
        HANDLE hSTD_OutStream = GetStdHandle(STD_OUTPUT_HANDLE); 
        COORD coord= { x,y }; SetConsoleCursorPosition( hSTD_OutStream,coord); 
        SetConsoleTextAttribute( hSTD_OutStream, c);   DWORD bytesRead=0;
        WriteConsole(hSTD_OutStream,text.c_str(),text.size(),&bytesRead,NULL );  
    }
    size_t x,y;
};



#endif